import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
var _excluded = ["anchor", "title", "visible", "children", "onCancel", "onOk"];
import React, { PureComponent } from 'react';
import { Modal } from 'antd';

var Drawers = /*#__PURE__*/function (_PureComponent) {
  _inherits(Drawers, _PureComponent);

  var _super = _createSuper(Drawers);

  function Drawers() {
    _classCallCheck(this, Drawers);

    return _super.apply(this, arguments);
  }

  _createClass(Drawers, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          anchor = _this$props.anchor,
          title = _this$props.title,
          visible = _this$props.visible,
          children = _this$props.children,
          onCancel = _this$props.onCancel,
          onOk = _this$props.onOk,
          others = _objectWithoutProperties(_this$props, _excluded);

      return /*#__PURE__*/React.createElement(Modal, Object.assign({
        title: title,
        wrapClassName: "ant-modal-sidebar-".concat(anchor),
        transitionName: "move-".concat(anchor),
        visible: visible,
        onOk: onOk,
        onCancel: onCancel,
        destroyOnClose: true // zIndex={9999}

      }, others), children);
    }
  }]);

  return Drawers;
}(PureComponent);

Drawers.defaultProps = {
  anchor: 'left',
  title: '',
  visible: false,
  onOk: function onOk(e) {
    return e;
  },
  onCancel: function onCancel(e) {
    return e;
  }
};
export { Drawers as default };